﻿using MediatR;
using SystemWFH.API.Application.Command.RepairProgreCommand;
using SystemWFH.Domain;
using SystemWFH.Infrstructer.Impl;
using SystemWFH.Infrstructer.Interface;

namespace SystemWFH.API.Application.CommandHandlers.RepairProgreCommandHandler
{
    public class RepairProgreFindCommandHandler : IRequestHandler<RepairProgreFindCommand, RepairProgre>
    {
        private readonly IRepairProgreRepository repairProgreRepository;
        public RepairProgreFindCommandHandler(IRepairProgreRepository repairProgreRepository)
        {
            this.repairProgreRepository = repairProgreRepository;
        }

        public async Task<RepairProgre> Handle(RepairProgreFindCommand request, CancellationToken cancellationToken)
        {
            //var str=request.repairprogresId == 1;
            var list = await repairProgreRepository.GetValue(request.repairprogresId);
            return list;
        }
    }
}
